import org.jsoup.Connection;
import org.jsoup.Jsoup;

import java.io.IOException;
import java.util.Map;

/**
 * Created by jiangzeyin on 2017/9/28.
 */
public class p {
    public static void main(String[] args) throws IOException {

        Map<String, String> loginPageCookies = Jsoup.connect("https://www.pixiv.net/login.php").proxy("127.0.0.1", 51660)
                .method(Connection.Method.POST).execute().cookies();

        String userName = "";
        String password = "";

        Connection.Response loginResponse = Jsoup.connect("https://www.pixiv.net/login.php").proxy("127.0.0.1", 51660)
                .data("mode", "login", "pixiv_id", userName, "1593503371@qq.com", password, "123456", "1")
                .cookies(loginPageCookies)
                .method(Connection.Method.POST).execute();

        Map<String, String> userCookies = loginResponse.cookies();

        System.out.println(Jsoup.connect("https://www.pixiv.net").proxy("127.0.0.1", 51660)
                .cookies(userCookies).get());

    }
}
